using UnityEngine;

public class GUIGroupNode : GUITreeNode
{
    protected override void DrawGUIComponents(GUINode[] components)
    {
        switch (Layout)
        {
        case LayoutType.Fixed:          GUI.BeginGroup(new Rect(PositionX, PositionY, Width, Height)); break;
        case LayoutType.AutoVertical:   GUILayout.BeginVertical(); break;
        case LayoutType.AutoHorizontal: GUILayout.BeginHorizontal(); break;
        }

        base.DrawGUIComponents(components);

        switch (Layout)
        {
        case LayoutType.Fixed:          GUI.EndGroup(); break;
        case LayoutType.AutoVertical:   GUILayout.EndVertical(); break;
        case LayoutType.AutoHorizontal: GUILayout.EndHorizontal(); break;
        }
    }
}